package com.xwt.pattern.proxy;

/**
 * Author:  Steven Xiao
 * Description:再定一个丑陋的王婆
 * Date:  2016/3/10
 * Time:  16:22
 */
public class WangPo implements KindWomen {
    private KindWomen kindWomen;

    public WangPo(){
        //默认的话，是潘金莲的代理
        this.kindWomen = new PanJinLian();
    }

    //她可以是KindWomen的任何一个女人的代理，只要你是这一类型
    public WangPo(KindWomen kindWomen) {
        this.kindWomen = kindWomen;
    }

    @Override
    public void makeEyeWithMan() {
        this.kindWomen.makeEyeWithMan(); //自己老了，干不了，可以让年轻的代替
    }

    @Override
    public void happyWithMan() {
        this.kindWomen.happyWithMan(); //王婆这么大年龄了，谁看她抛媚眼？！
    }
}
